package com.pms.controller;

import com.pms.result.Result;
import com.pms.service.DashboardService;
import com.pms.vo.DashboardCountVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "首页相关接口")
@RestController
@RequestMapping("/dashboard")
@Slf4j
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    @ApiOperation("统计数据")
    @GetMapping("/count")
    public Result<DashboardCountVO> count(){
        log.info("统计数据");
        DashboardCountVO dashboardCountVO=dashboardService.count();
        return Result.success(dashboardCountVO);
    }
}
